<div id="Modifying-tags"></div>
<div class="header">
<p>
Next: [[cvs: Tagging and adding and removing files#Tagging and adding and removing files|Tagging add/remove]], Previous: [[cvs: Specifying what to tag by date or revision#Specifying what to tag by date or revision|Tagging by date/tag]], Up: [[cvs: Revisions#Revisions|Revisions]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>

----

<div id="Deleting_002c-moving_002c-and-renaming-tags"></div>
=== Deleting, moving, and renaming tags ===


Normally one does not modify tags.  They exist in order
to record the history of the repository and so deleting
them or changing their meaning would, generally, not be
what you want.

However, there might be cases in which one uses a tag
temporarily or accidentally puts one in the wrong
place.  Therefore, one might delete, move, or rename a
tag.

'''WARNING: the commands in this section are
dangerous; they permanently discard historical
information and it can be difficult or impossible to
recover from errors.  If you are a <small>CVS</small>
administrator, you may consider restricting these
commands with taginfo (see [[cvs: User-defined logging#User-defined logging|user-defined logging]]).'''

<div id="index-Deleting-tags"></div>
<div id="index-Deleting-branch-tags"></div>
<div id="index-Removing-tags"></div>
<div id="index-Removing-branch-tags"></div>
<div id="index-Tags_002c-deleting"></div>
<div id="index-Branch-tags_002c-deleting"></div>
To delete a tag, specify the &lsquo;<code>-d</code>&rsquo; option to either
<code>cvs tag</code> or <code>cvs rtag</code>.  For example:

<div class="example" style="margin-left: 3.2em">
 cvs rtag -d rel-0-4 tc
</div>

deletes the non-branch tag <code>rel-0-4</code> from the module <code>tc</code>.
In the event that branch tags are encountered within the repository
with the given name, a warning message will be issued and the branch 
tag will not be deleted.  If you are absolutely certain you know what
you are doing, the <code>-B</code> option may be specified to allow deletion
of branch tags.  In that case, any non-branch tags encountered will
trigger warnings and will not be deleted.

'''WARNING: Moving branch tags is very dangerous!  If you think
you need the <code>-B</code> option, think again and ask your <small>CVS</small>
administrator about it (if that isn&rsquo;t you).  There is almost certainly
another way to accomplish what you want to accomplish.'''

<div id="index-Moving-tags"></div>
<div id="index-Moving-branch-tags"></div>
<div id="index-Tags_002c-moving"></div>
<div id="index-Branch-tags_002c-moving"></div>
When we say <em>move</em> a tag, we mean to make the same
name point to different revisions.  For example, the
<code>stable</code> tag may currently point to revision 1.4
of &lsquo;<tt>backend.c</tt>&rsquo; and perhaps we want to make it
point to revision 1.6.  To move a non-branch tag, specify the
&lsquo;<code>-F</code>&rsquo; option to either <code>cvs tag</code> or <code>cvs
rtag</code>.  For example, the task just mentioned might be
accomplished as:

<div class="example" style="margin-left: 3.2em">
 cvs tag -r 1.6 -F stable backend.c
</div>

If any branch tags are encountered in the repository 
with the given name, a warning is issued and the branch
tag is not disturbed.  If you are absolutely certain you
wish to move the branch tag, the <code>-B</code> option may be specified.
In that case, non-branch tags encountered with the given
name are ignored with a warning message.

'''WARNING: Moving branch tags is very dangerous!  If you think you
need the <code>-B</code> option, think again and ask your <small>CVS</small>
administrator about it (if that isn&rsquo;t you).  There is almost certainly
another way to accomplish what you want to accomplish.'''

<div id="index-Renaming-tags"></div>
<div id="index-Tags_002c-renaming"></div>
When we say <em>rename</em> a tag, we mean to make a
different name point to the same revisions as the old
tag.  For example, one may have misspelled the tag name
and want to correct it (hopefully before others are
relying on the old spelling).  To rename a tag, first
create a new tag using the &lsquo;<code>-r</code>&rsquo; option to
<code>cvs rtag</code>, and then delete the old name.  (Caution:
this method will not work with branch tags.) 
This leaves the new tag on exactly the 
same files as the old tag.  For example:

<div class="example" style="margin-left: 3.2em">
 cvs rtag -r old-name-0-4 rel-0-4 tc
 cvs rtag -d old-name-0-4 tc
</div>


----

<div class="header">
<p>
Next: [[cvs: Tagging and adding and removing files#Tagging and adding and removing files|Tagging add/remove]], Previous: [[cvs: Specifying what to tag by date or revision#Specifying what to tag by date or revision|Tagging by date/tag]], Up: [[cvs: Revisions#Revisions|Revisions]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>
This document was generated on <i>a sunny day</i> using [http://www.nongnu.org/texi2html/ <i>texi2html</i>].
